<?php defined('RUN_KATANA') or die('Restricted access'); ?>
<?php 
if(OUTPUT_FORMAT == 'json')
{
	$items = $adc->getAdBrands();
	if($items)
	{
		$i = 0;
		foreach($items as $item)
		{
			$json[$i]['id'] = $item->getId();
			$json[$i]['TypeId'] = $item->getTypeId();
			$json[$i]['CatId'] = $item->getCatId();
			$json[$i]['title'] = $item->getTitle();
			$json[$i]['Description'] = $item->getDescription();
			$json[$i]['active'] = $item->getActive();
			$i++;
		}
		echo json_encode($json);
	}
}
/*
if(OUTPUT_FORMAT == 'json')
{
	$items = $adc->getAdBrands();
	if($items)
	{
		$i = 0;
		$adc->loadAdTypes();
		$json['page'] = $adc->Pager->getPageCurrent();
		$json['total'] = $adc->Pager->getPagesCount();
		$json['records'] = $adc->Pager->getItemsTotal();
		
		foreach($items as $item)
		{
			$type = ucfirst($txt->getWord('all'));
			if($adc->getAdTypeTitle($item->getTypeId()) != '')
			{ $type = $adc->getAdTypeTitle($item->getTypeId()); }
			
			$cat = ucfirst($txt->getWord('all'));
			if($adc->getAdCatTitle($item->getCatsId()) != '')
			{ $cat = $adc->getAdCatTitle($item->getCatsId()); }
			
			$json['rows'][$i]['id'] = $item->getId();
			$json['rows'][$i]['cell'] = array($item->getId(), $item->getTitle(), $item->getDescription(), $type, $cat, $item->getActive());
			$i++;
		}
		echo json_encode($json);
	}
}
*/
?>